package com.greateamd.timetableasy.server.dao;

import java.sql.SQLException;
import java.util.Date;
import java.util.List;

import org.hibernate.HibernateException;
import org.springframework.security.access.prepost.PreAuthorize;

import com.greateamd.timetableasy.domain.Event;
import com.greateamd.timetableasy.domain.University;
import com.greateamd.timetableasy.domain.exceptions.DBServerSideException;
import com.greateamd.timetableasy.domain.exceptions.IllegalEntityStateException;


public interface UniversityDAO extends IBaseDao<University, Integer>{
	@Override @PreAuthorize("hasRole('ROLE_ADMIN')")
	void save(University university) throws HibernateException,SQLException;
	
	@Override @PreAuthorize("hasRole('ROLE_ADMIN')")
	public void update(University university)throws HibernateException,SQLException,IllegalAccessException;
	
	@Override @PreAuthorize("hasRole('ROLE_ADMIN')")
	public void delete(University university)throws HibernateException,SQLException,IllegalAccessException;
	
	University findByName(String name) throws DBServerSideException;
	
	List<Event> getPlanning(University university, Date from, Date to)throws DBServerSideException,IllegalEntityStateException;
}
